﻿@model projectManagementWeb.Models.ProjectLeader.ProjectLeaderAvailableTask


@{
    ViewBag.Title = "ProjectLeaderAvailableTasksform";
}

     <p align="right">
            @Html.ActionLink("<< Regresar", "ProjectLeaderAssignResourcesform")
     </p>

@if (ViewBag.projectID != 0)
{

<fieldset>

    <legend>Bienvenido</legend>
    <h1>@User.Identity.Name</h1>

    @{        
    projectManagementWeb.Controllers.ProjectLeaderController controlLayer = new projectManagementWeb.Controllers.ProjectLeaderController();
    }
    
</fieldset>

<fieldset>


     @Html.ValidationSummary(true)

     @{ 
    List<projectManagementWeb.Models.ProjectLeader.ProjectLeaderAvailableTask> tareas = @ViewBag.tareas;
     }
     
     <legend>Lista de Tareas sin Asignar</legend>
    @using (Html.BeginForm("assignTasks", "ProjectLeader", FormMethod.Post))
    {
     <table>
        <tr>
            <td> </td>
            <td>Id de la Tarea</td>
            <td>Nombre de la Tarea</td>
            <td>Descripción</td>
            <td>Fecha de Inicio</td>
            <td>Fecha de Fin</td>
            <td>Esfuerzo Planeado</td>
        </tr>
         @for (int i = 0; i < tareas.Count; i++)
         { 
             <tr>
             <td>@Html.CheckBox("AsignarTarea" + tareas[i].ID, false, new { @id = "assignTaskChbx" + tareas[i].ID, @name = "assignTaskChbx" + tareas[i].ID })</td>
             <td>@tareas[i].ID</td>
             <td>@tareas[i].name</td>
             <td>@tareas[i].description</td>
             <td>@tareas[i].StartDate.Date.ToShortDateString()</td>
             <td>@tareas[i].EndDate.Date.ToShortDateString()</td>
             <td>@tareas[i].taskEffortPlanned</td>
             </tr>
         }
     </table>
    
    <input type="submit" value="Asignar" />
    <input type="hidden" name= "userId" value="@ViewBag.userId" />
    }


</fieldset>
}
else
{
    <h2>
        El usuario no tiene proyectos/módulos asignados.  
    </h2>
}